#pragma once

template<class T>
class Singleton
{
public:
	virtual ~Singleton(void) {}
	static T* getInstance();

protected:
	Singleton(void) {}
	static T* instance_;
};

template<class T>
T* Singleton<T>::instance_ = NULL;

template<class T>
T* Singleton<T>::getInstance() 
{ 
	if (instance_ == NULL)
		instance_ = new T;
	return instance_;
}